package com.alipay.app.groupmeal.standard.thread;

import com.alipay.app.groupmeal.standard.event.EventManager;
import com.alipay.app.groupmeal.standard.event.TimeEvent;

import org.greenrobot.eventbus.EventBus;

public class TimeThread extends Thread {
    public long lastTimes = 0L;

    public TimeThread() {
    }

    @Override
    public void run() {
        while (true) {
//            System.out.println("时间开始");
            if ((System.currentTimeMillis() - lastTimes) > ( 60 * 1000)) {
                lastTimes = System.currentTimeMillis();
                EventBus.getDefault().post(new EventManager.tongbuOrder());
            }
            try {
                sleep(1000);
            } catch (Exception e) {
                e.printStackTrace();
            }
            EventBus.getDefault().post(new TimeEvent());
        }
    }
}
